package it.blueocean.acanto.taglibrary.jsp.taglib.tags.dataset;

import it.blueocean.acanto.platform.util.ApplicationContextProvider;

import org.springframework.context.ApplicationContext;


public class DatasetFactory
{
	private static DatasetFactory instance_;
	
	private static final String HIBERNATE = "default.hibernate";

	public static DatasetFactory getInstance()
	{
		if(instance_ == null)
		{
			instance_ = new DatasetFactory();
		}
		return instance_;
	}

	public DataSet buildDataset() throws Exception
	{
		ApplicationContext ctx = ApplicationContextProvider.getApplicationContext();
		DataSet dataSet = (DataSet) ctx.getBean("hibernateDataset");
		
		return dataSet;
	}
}
